/* Moderator	: helpbygrace ( helpbygrace_AT_gmail.com ) */
/**********************************************************
  CISS를 구동하기 위한 기본적인 모듈이 들어있다.
  기본 모듈은 크게 아래와 같이 분류 된다.
    - Command Interpreter & Executor
    - Text In & Out
    - Performance Analyzer ( MIPS )

  이 모듈의 interface는 header파일에 담겨있고, 그 선언은
  c source파일에 담겨있다.
  ********************************************************/
#ifndef	_command_h_
#define	_command_h_
#include "proc.h"
#include "mem.h"
int ciss(void);

#define CISS_VERSION	"v0.0.1-alpha"
/* Command Interpreter */
#define	COMMAND_FORMAT(FN)	int FN (proc_t * proc, mem_t * mem, int optc, char * opts[])
#define COMMAND_DECLARE(FN)	int FN (proc_t *, mem_t *, int, char **)
COMMAND_DECLARE(cmd_run);
COMMAND_DECLARE(cmd_continue);
COMMAND_DECLARE(cmd_step);
COMMAND_DECLARE(cmd_info);
COMMAND_DECLARE(cmd_quit);
COMMAND_DECLARE(cmd_mem);
COMMAND_DECLARE(cmd_break);
COMMAND_DECLARE(cmd_watch);
COMMAND_DECLARE(cmd_delete);

/* command struct : which contains command name, 
   functional pointer for executing, and help string */
typedef	struct
{
  char	* name;
  COMMAND_DECLARE((*function));
  char	* help;
} command_t;

/* command list */
command_t	cmds[] = {
      {"run",	cmd_run,	"Run to the end of program"},
      {"continue",cmd_continue,	"Continue the program until meets breakpoint"},
      {"step",	cmd_step,	"Execute one line"},
      {"info",	cmd_info,	"Get the information of processor"},
      {"quit",	cmd_quit,	"Exit this simulator"},
      {"mem",	cmd_mem,	"Set memory"},
      {"break",	cmd_break,	"Set breakpoint"},
      {"watch",	cmd_watch,	"Set watchpoint"},
      {"delete",cmd_delete,	"Remove bp/wp"},
      {NULL,	NULL,		NULL}
};

#endif /* _command_h_ */
